<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>
  <%@ include file="/common/extjs.jsp"%>
<script type="text/javascript" >
 /** 
 * 附件管理窗口
 */
 function showUploadWin(no)  {
	 var projectid ='${(empty param.projectId) ?(projectInfo.projectId):(param.projectId)}';
 	 var fid ='${param.fid}';
        if(no ==1){
           var tableName = "supervisionProLixiang";
           var tableField = [['supervisionProLixiang','项目立项批复文件']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUploadJquery("项目立项批复文件");
        }else if(no ==2){
        	var tableName = "supervisionFirstDesignCheck";
            var tableField = [['supervisionFirstDesignCheck','初步设计审查批复文件']
    					 ];
           projectAttachment.init(projectid,fid,tableName,tableField);
           projectAttachment.showUploadJquery("初步设计审查批复文件 ");
          }else if(no ==3){
        	  var tableName = "supervisorDesignContractFile";
          var tableField = [['supervisordesignBiddocument','设计招标文件 '],['supervisordesignWinningNotice','设计中标通知书']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUploadJquery("设计合同协议书含招标文件及中标通知书");
        }else if(no ==4){
        	var tableName = "supervisorConstructContractFile";
          var tableField = [['supervisorConstructBiddocument','施工招标文件'],['supervisorConstructWinningNotice','施工中标通知书  ']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUploadJquery("施工合同协议书含招标文件及中标通知书 ");
        }else if(no ==5){
        	var tableName = "supervisorContractFile";
          var tableField = [['supervisorBiddocument','监理招标文件'],['WinningNotice','监理中标通知书']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUploadJquery("监理合同协议书含招标文件及中标通知书 ");
        }else if(no ==6){
        	var tableName = "supervisorCreditQualification";
          var tableField = [['supervisorCreditQualification ','监理单位的资信和资质证明材料']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUploadJquery("监理单位的资信和资质证明材料 ");
        }else if(no ==7){
        	var tableName = "supervisorConstructCreditQualification";
            var tableField = [['supervisorConstructCreditQualification ','施工单位的资信和资质证明材料']
    					 ];
           projectAttachment.init(projectid,fid,tableName,tableField);
           projectAttachment.showUploadJquery("施工单位的资信和资质证明材料 ");
          }else if(no ==8){
          	var tableName = "supervisorPeopleQualificationCertificate";
            var tableField = [['supervisorPeopleQualificationCertificate','监理单位的人员名单及资格证书']
    					 ];
           projectAttachment.init(projectid,fid,tableName,tableField);
           projectAttachment.showUploadJquery("监理单位的人员名单及资格证书");
          }else if(no ==9){
            	var tableName = "supervisorConstructPeopleQualificationCertificate";
                var tableField = [['supervisorConstructPeopleQualificationCertificate','施工单位的人员名单及资格证书']
        					 ];
               projectAttachment.init(projectid,fid,tableName,tableField);
               projectAttachment.showUploadJquery("施工单位的人员名单及资格证书");
              }else if(no ==10){
                	var tableName = "supervisorplanninginplementing";
                    var tableField = [['supervisorplanninginplementing','监理规划、 实施细则']
            					 ];
                   projectAttachment.init(projectid,fid,tableName,tableField);
                   projectAttachment.showUploadJquery("监理规划、 实施细则");
                  }else if(no ==11){
                    	var tableName = "supervisorLabsEquipPeople";
                        var tableField = [['supervisorLabsEquipPeople','监理中心试验室试验检测装备及人员配置情况']
                					 ];
                       projectAttachment.init(projectid,fid,tableName,tableField);
                       projectAttachment.showUploadJquery("监理中心试验室试验检测装备及人员配置情况");
                      }
                  else if(no ==12){
                  	var tableName = "supervisorEngineeringGeologicalDesign";
                      var tableField = [['supervisorEngineeringGeologicalDesign','工程项目地质设计文件']
              					 ];
                     projectAttachment.init(projectid,fid,tableName,tableField);
                     projectAttachment.showUploadJquery("工程项目地质设计文件");
                    }
                  else if(no ==13){
                  	var tableName = "supervisorSurveyDesignDocuments";
                      var tableField = [['supervisorSurveyDesignDocuments','工程项目水文勘察资料设计文件']
              					 ];
                     projectAttachment.init(projectid,fid,tableName,tableField);
                     projectAttachment.showUploadJquery("工程项目水文勘察资料设计文件");
                    }
                  else if(no ==14){
                  	var tableName = "supervisorConstructionDrawingDesign";
                      var tableField = [['supervisorConstructionDrawingDesign','工程项目施工图审查设计文件']
              					 ];
                     projectAttachment.init(projectid,fid,tableName,tableField);
                     projectAttachment.showUploadJquery("工程项目施工图审查设计文件");
                    }
                  else if(no ==15){
                    	var tableName = "supervisorTrafficEngineeringQuality ";
                        var tableField = [['supervisorTrafficEngineeringQuality','交通工程质量监督申请表']
                					 ];
                       projectAttachment.init(projectid,fid,tableName,tableField);
                       projectAttachment.showUploadJquery("交通工程质量监督申请表");
                      }
   }  


 
Ext.onReady(function(){
  Ext.QuickTips.init();
  var myData = [
                ['1','1','项目立项批复文件'],
                ['2','2','初步设计审查批复文件'],
                ['3','3','设计合同协议书含招标文件及中标通知书'],
                ['4','4','施工合同协议书含招标文件及中标通知书'],
                ['5','5','监理合同协议书含招标文件及中标通知书'],
                ['6','6','监理单位的资信和资质证明材料'],
                ['7','7','施工单位的资信和资质证明材料'],
                ['8','8','监理单位的人员名单及资格证书'],
                ['9','9','施工单位的人员名单及资格证书'],
                ['10','10','监理规划、 实施细则'],
                ['11','11','监理中心试验室试验检测装备及人员配置情况'],
                ['12','12','工程项目地质设计文件'],
                ['13','13','工程项目水文勘察资料设计文件'],
                ['14','14','工程项目施工图审查设计文件'],
                ['15','15','交通工程质量监督申请表']
                           
    ];
     // Record
    MpSupervisionAffix = Ext.data.Record.create([
                                    {name: 'no', type: 'string'},
    								{name: 'kind', type: 'string'},
    								{name: 'file', type: 'string'},
    ]);
    
    // create the data store
    var store = new Ext.data.Store({
        reader: new Ext.data.ArrayReader(
        {
            idIndex: 0  // id for each record will be the first element
        },MpSupervisionAffix)
    });
  store.loadData(myData);
  
  var cm = new Ext.grid.ColumnModel([
       {header: "序号", width: 45, dataIndex: 'no'},
       {header: "kind", width: 75, dataIndex: 'kind',hidden: true},
       {id:'file',header: "监督申请", width: 360, dataIndex: 'file',renderer:Jinyi.project.Format.textAreaRenderer},
       {
					           header:  	'资料查询',
							   align: 'center',
								dataIndex : '',
					           renderer: function(value, metaData, record, rowIndex, colIndex, store) {
					            var no = record.get('no');
					          //  if(no == 2){
					            //    return; 
					           // }
					            var href = "<span class='upload_renderer'><a href='javascript:showUploadWin(\""+no+"\")' >查看资料</a></span>";
					            return href;
					           },  
					           width: 		180
     	 }
  
  ]);
  
   // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        cm: cm,
        tbar:[{text:"批量下载",handler:function(){
         	 var projectid ='${(empty param.projectId) ?(projectInfo.projectId):(param.projectId)}';
         	 var fid ='${param.fid}';
        	location.href = "${ctx}/attachment/attachment!downloadMany.action?tableId="+fid+"&partId="+projectid;
        }}],
        sm:	new Ext.grid.RowSelectionModel({singleSelect:true}),
        frame:true,
		viewConfig: {
       		forceFit: false,
        	getRowClass: function(record, index) {
   			 }
   			},
        loadMask:true, 
        autoExpandColumn: 'file'
    });
    
    var viewport = new Ext.Viewport({
        layout:'fit',
        items:[grid]
        });
})
</script>
<body>
<div id="mpSupervisionAffixGrid"></div>
</body>



